<template>
  <div class="app-container">
    <el-card>
      <p class="pinformation">现场原始记录搜索</p>
      <el-form ref="queryRef" label-width="80" :model="queryParams">
        <el-row>
          <el-col :span="4">
            <el-form-item label="点位名称：" prop="produceName">
              <el-input
                clearable
                maxlength="100"
                placeholder="请输入点位名称"
                v-model="queryParams.a"
              />
            </el-form-item>
          </el-col>
          <el-col :span="4">
            <el-form-item label="合同名称：" prop="produceName">
              <el-input
                clearable
                maxlength="100"
                placeholder="请输入合同名称"
                v-model="queryParams.a"
              />
            </el-form-item>
          </el-col>
          <el-col :span="5">
            <el-form-item label="委托单位：" prop="produceName">
              <el-input
                clearable
                maxlength="100"
                placeholder="请输入委托单位"
                v-model="queryParams.a"
              />
            </el-form-item>
          </el-col>
          <el-col :span="5">
            <el-form-item
              label="时间范围类型："
              prop="produceName"
              label-width="100"
            >
              <el-row>
                <el-radio v-model="queryParams.isLike" label="0"
                  >按合同登记时间</el-radio
                >
                <el-radio v-model="queryParams.isLike" label="1"
                  >按回款时间</el-radio
                >
              </el-row>
            </el-form-item>
          </el-col>
          <el-col :span="4">
            <el-form-item label="时间范围：" prop="produceName">
              <el-date-picker
                v-model="dateRange"
                value-format="YYYY-MM-DD"
                type="daterange"
                range-separator="-"
                start-placeholder="开始日期"
                end-placeholder="结束日期"
              ></el-date-picker>
            </el-form-item>
          </el-col>
          <el-col :span="2">
            <el-row style="justify-content: center">
              <el-button type="success">搜索</el-button>
              <el-button class="resetBtn">重置</el-button>
            </el-row>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="4">
            <el-form-item label="业务员：" prop="produceName">
              <el-input
                clearable
                maxlength="100"
                placeholder="请输入业务员"
                v-model="queryParams.l"
              />
            </el-form-item>
          </el-col>
          <el-col :span="4">
            <el-form-item label="超支对象：" prop="produceName">
              <el-input
                clearable
                maxlength="100"
                placeholder="请输入超支对象"
                v-model="queryParams.h"
              />
            </el-form-item>
          </el-col>
          <el-col :span="5">
            <el-form-item
              label="状态："
              prop="produceName"
            >
              <el-input
                clearable
                maxlength="100"
                placeholder="请输入状态"
                v-model="queryParams.n"
              />
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
      <p class="pinformation">统计信息</p>
      <el-form :model="queryParams" ref="queryRef" label-width="100">
        <el-row>
          <el-col :span="4">
            <el-form-item label="合同总额：" prop="fileMc"> <span style="font-size: 18px; font-weight: 700;">345980.12</span> </el-form-item>
          </el-col>
          <el-col :span="4">
            <el-form-item label="实收总额：" prop="fileMc"> <span style="font-size: 18px; font-weight: 700;">345980.12</span> </el-form-item>
          </el-col>
          <el-col :span="4">
            <el-form-item label="已收总额：" prop="fileMc"> <span style="font-size: 18px; font-weight: 700;">145980.12</span> </el-form-item>
          </el-col>
          <el-col :span="4">
            <el-form-item label="未收总额：" prop="fileMc"> <span style="font-size: 18px; font-weight: 700;">20000.00</span> </el-form-item>
          </el-col>
          <el-col :span="4">
            <el-form-item label="已开票总额：" prop="fileMc"> <span style="font-size: 18px; font-weight: 700;">10000.00</span> </el-form-item>
          </el-col>
          <el-col :span="4">
            <el-form-item label="未开票总额：" prop="fileMc"> <span style="font-size: 18px; font-weight: 700;">10000.00</span> </el-form-item>
          </el-col>
        </el-row>
        <el-row>
            <el-col :span="4">
            <el-form-item label="超支金额：" prop="fileMc"> 123657.12 </el-form-item>
          </el-col>
            <el-col :span="4">
            <el-form-item label="超支扣税：" prop="fileMc"> 123657.12 </el-form-item>
          </el-col>
            <el-col :span="4">
            <el-form-item label="分包金额：" prop="fileMc"> 123657.12 </el-form-item>
          </el-col>
            <el-col :span="4">
            <el-form-item label="业务提成：" prop="fileMc"> 123657.12 </el-form-item>
          </el-col>
        </el-row>
      </el-form>

      <p class="pinformation">合同列表</p>
      <el-table :data="tableData" ref="dataTableRef">
        <el-table-column
          align="center"
          show-overflow-tooltip
          label="合同编号"
          prop="jclbName"
        />
        <el-table-column
          align="center"
          show-overflow-tooltip
          label="合同名称"
          prop="pointName"
        />
        <el-table-column
          align="center"
          show-overflow-tooltip
          label="委托单位"
          prop="sampleDay"
        />
        <el-table-column
          align="center"
          show-overflow-tooltip
          label="业务员"
          prop="sampleCount"
        />
        <el-table-column
          align="center"
          show-overflow-tooltip
          label="创建时间"
          prop="name"
        />
        <el-table-column
          align="center"
          show-overflow-tooltip
          label="上回回款日期"
          prop="user1"
        />
        <el-table-column
          align="center"
          show-overflow-tooltip
          label="合同金额"
          prop="date1"
        />
        <el-table-column
          align="center"
          show-overflow-tooltip
          label="已收金额"
          prop="user2"
        />
        <el-table-column
          align="center"
          show-overflow-tooltip
          label="备注"
          prop="date2"
        />
        <el-table-column
          align="center"
          show-overflow-tooltip
          label="状态"
        />
        <el-table-column
          label="操作"
          align="center"
          width="310"
        >
          <template #default="scope">
            <el-button link type="success">修改金额</el-button>
            <el-button link type="success">财务记录</el-button>
            <el-button link type="success">申请发票</el-button>
            <el-button link type="success">申请超支</el-button>
          </template>
        </el-table-column>
      </el-table>
    </el-card>
  </div>
</template>

<script setup>
const { proxy } = getCurrentInstance();
const tableData = ref([
]);
const dateRange = ref([]);
const queryParams = ref({});

const heightParams = ref([{ tableName: "data", bottomHeight: 21 }]);
function getTableHeight() {
  proxy.adaptiveHeight(proxy, heightParams.value);
}

onMounted(() => {
  nextTick(function () {
    getTableHeight();
    window.addEventListener("resize", getTableHeight);
  });
});

onUpdated(() => {
  nextTick(function () {
    getTableHeight();
    window.addEventListener("resize", getTableHeight);
  });
});
onBeforeUnmount(() => {
  window.removeEventListener("resize", getTableHeight);
});
</script>

<style></style>
